var express = require('express');
var multer  = require('multer');
var upload = multer({ dest:'public/uploads/' });
var router = express.Router();
var uploads=require('../controll/upload');

router.post('/profile', upload.single('avatar'), function (req, res, next) {
    uploads.post(req,res,next);
  })
router.post('/list', function(req, res, next) {
    uploads.list(req,res,next);
  });
router.put('/data/:id', function(req, res, next) {
    uploads.put(req,res,next);
  });
router.delete('/data/:id', function(req, res, next) {
    uploads.delete(req,res,next);
  });
router.get('/file',function(req, res, next) {
  uploads.getFile(req,res,next);
})
module.exports = router;
